<template>
  <div>
    <div class="fake-title-bar">
      <div class="handle-bar">
        <i class="el-icon-minus" @click="reduceSystem"></i>
        <i class="el-icon-close" @click="closeSystem"></i>
      </div>
    </div>
    <menu-item />
    <router-view />
    <div class="line"></div>
  </div>
</template>

<script>
// @ is an alias to /src
const { ipcRenderer, remote } = window.require("electron");
import MenuItem from "./menu/index";
export default {
  name: "Home",
  components: {
    MenuItem,
  },
  data() {
    return {};
  },
  methods: {
    closeSystem() {
      ipcRenderer.send("closeSystem", true);
    },
    reduceSystem() {
      console.log(remote);
      const browserWindow = remote.getCurrentWindow();
      browserWindow.hide();
    },
  },
};
</script>
<style lang="stylus" scope>
.fake-title-bar {
  -webkit-app-region: drag;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  height: 37px;
  border-bottom: 2px solid #66b1ff;
  background: #2f333d;
}

.handle-bar {
  width: 70px;
  position: absolute;
  right: 0;
  top: 5px;
  -webkit-app-region: no-drag;
  display: flex;
  justify-content: space-around;
}

.handle-bar i {
  color: #b1acac;
  padding: 5px;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.handle-bar i:hover {
  background: #fff;
  transform: scale(1.1);
  color: #282c34;
}

.upload {
  width: 800px;
  height: 608px;
  margin-left: 200px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-top: 22px;
}

.personExcel {
  width: 50%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-content: center;
  flex-direction: column;
  border-top-right-radius: 50%;
  border-right: 2px solid #409eff;
  box-sizing: border-box;

  .world {
    color: #fff;
    text-align: center;
    font-size: 22px;
    user-select: none;
    height: 90px;
    font-weight: bold;
  }

  .uploadBlock {
    overflow: hidden;
    width: 80%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    border: 2px dashed #fff;
    margin: 0 auto;
    border-radius: 5px;

    i {
      font-size: 80px;
      color: #fff;
    }
  }

  .uploadBlock:hover {
    // transform: scale(1.1);
    border: 2px dashed #409eff;
    transition: all 0.3s ease;

    i {
      font-size: 80px;
      color: #409eff;
      transition: all 0.3s ease;
    }
  }
}

#file-uploader {
  visibility: hidden;
  width: 0;
  height: 0;
}

.line {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: #409eff;
  z-index: 100000;
}
</style>
